import Taro, { Component } from '@tarojs/taro'
import { Image, View } from '@tarojs/components'
import './index.scss'
import classNames from 'classnames'
import { toAnyPage } from '@/utils/page_router'

interface IProps {
  list: any
  className: string
}

/**
 * 拼图展示方式1
 */
export default class Index extends Component<IProps, {}> {
  props: any
  static options = {
    addGlobalClass: true
  }

  render() {
    const { list=[], className }:any = this.props
    return (<View className={classNames('custom-puzzle-one d-f f-w-w j-c-b', className)}>
      {list.map((i, k) => {
        return (<Image key={k} src={i.pic} className='img-item' onClick={() => toAnyPage(i.url)}/>)
      })}
    </View>)
  }
}
